<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="/web/system/admin/include :: top"></th:block>
</head>
<body class="gray-bg">

<form class="layui-form" action="" id="form">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
        <legend>基础信息设置</legend>
    </fieldset>
    <hr class="layui-bg-green">
    <table class="layui-table" style="width:95%;margin:10px auto;">
        <tr>
            <td width="15%" align="right"><label class="layui-form-label">表名称：<span style="color: red">*</span></label></td>
            <td th:text="${p.table_name}"></td>
            <td width="15%" align="right"><label class="layui-form-label">表描述：<span style="color: red">*</span></label></td>
            <td th:text="${p.table_comment}"></td>
        </tr>
        <tr>
            <td width="15%" align="right"><label class="layui-form-label">模板类型：<span style="color: red">*</span></label></td>
            <td>
                <th:block th:text="${p.temp_type=='0'}">单表</th:block>
                <th:block th:text="${p.temp_type=='1'}">主子表</th:block>
                <th:block th:text="${p.temp_type=='2'}">树表</th:block>
            </td>
            <td width="15%" align="right"><label class="layui-form-label">生成包路径：<span style="color: red">*</span></label></td>
            <td th:text="${p.pack_path}"></td>
        </tr>
        <tr>
            <td width="15%" align="right"><label class="layui-form-label">生成模块名：<span style="color: red">*</span></label></td>
            <td th:text="${p.mod_name}"></td>
            <td width="15%" align="right"><label class="layui-form-label">生成业务名：<span style="color: red">*</span></label></td>
            <td th:text="${p.bus_name}"></td>
        </tr>
        <tr>
            <td width="15%" align="right"><label class="layui-form-label">功能名称：<span style="color: red">*</span></label></td>
            <td th:text="${p.menu_name}"></td>
            <td width="15%" align="right"><label class="layui-form-label">上级菜单：<span style="color: red">*</span></label></td>
            <td th:text="${p[m_name]?:''}">
            </td>
        </tr>
        <tr>
            <td width="15%" align="right"><label class="layui-form-label">是否批量添加：</label></td>
            <td>
                <th:block th:if="${p.more_add=='0'}">否</th:block>
                <th:block th:if="${p.more_add=='1'}">是</th:block>
            </td>
            <td width="15%" align="right"><label class="layui-form-label">状态类型：</label></td>
            <td>
                <th:block th:if="${p.status_type=='0'}">单启用</th:block>
                <th:block th:if="${p.status_type=='1'}">多启用</th:block>
            </td>
        </tr>
        <tr>
            <td width="15%" align="right"><label class="layui-form-label">生成方式：</label></td>
            <td>
                <th:block th:if="${p.more_add=='0'}">zip包下载</th:block>
                <th:block th:if="${p.more_add=='1'}">生成到指定路径</th:block>
            </td>
            <th:block th:if="${p.more_add=='1'}">
                <td width="15%" align="right"><label class="layui-form-label">生成路径：</label></td>
                <td th:text="${p.gen_path}"></td>
            </th:block>
        </tr>
    </table>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
        <legend>字段信息设置</legend>
    </fieldset>
    <hr class="layui-bg-green">
    <table class="layui-table" style="width: 99%;margin: 0 auto">
        <thead>
        <tr>
            <th>序号</th>
            <th width="8%">字段名称</th>
            <th width="8%">字段描述</th>
            <th width="8%">字段类型</th>
            <th>添加编辑</th>
            <th>列表展示</th>
            <th>查询展示</th>
            <th>查询方式</th>
            <th>校验规则</th>
            <th>显示类型</th>
            <th>选项内容</th>
            <th>默认值</th>
            <th>排序</th>
        </tr>
        </thead>
        <tbody id="table">
        <tr>
            <td colspan="13" style="line-height: 32px">
                说明：字段【
                <th:block th:each="var,status:${list}">
                    <th:block th:if="${#strings.containsIgnoreCase(pd.excludeField,var.field_name)}">
                        ${var.field_name}
                    </th:block>
                </th:block>
                】属于系统保留字段，会默认存储使用，不可设置业务操作，如需操作可后续修改代码使用！！！
            </td>
        </tr>
        <th:block th:each="var,status:${list}">
            <th:block th:unless="${#strings.containsIgnoreCase(pd.excludeField,var.field_name)}">
                <tr style="height: 40px">
                <td th:text="${status.index}"></td>
                <td th:text="${var.field_name}"></td>
                <td th:text="${var.field_comment}"></td>
                <td th:text="${var.field_type}"></td>
                <td>
                    <th:block th:if="${var.field_operat=='Y'}">
                        <input type="checkbox" lay-skin="primary" disabled lay-filter='checkField' checked title="">
                    </th:block>
                    <th:block th:if="${var.field_operat!='Y'}">
                        <input type="checkbox" lay-skin="primary" disabled lay-filter='checkField' title="">
                    </th:block>
                <td>
                    <th:block th:if="${var.field_list=='Y'}">
                        <input type="checkbox"  disabled lay-skin="primary" checked title="">
                    </th:block>
                    <th:block th:if="${var.field_list!='Y'}">
                        <input type="checkbox"  disabled lay-skin="primary" title="">
                    </th:block>
                </td>
                <td>
                    <th:block th:if="${var.field_query=='Y'}">
                        <input type="checkbox" disabled lay-skin="primary" checked title="">
                    </th:block>
                    <th:block th:if="${var.field_query!='Y'}">
                        <input type="checkbox" disabled lay-skin="primary" title="">
                    </th:block>
                </td>
                <td th:text="${var.query_type}">
                </td>
                <td>
                    <th:block th:unless="${#strings.containsIgnoreCase(var.verify_rule,',')}">
                        <span th:text="${var.verify_rule}"></span>
                    </th:block>
                    <th:block th:if="${var.verify_rule=='required'}">必输</th:block>
                    <th:block th:if="${var.verify_rule=='phone'}">电话</th:block>
                    <th:block th:if="${var.verify_rule=='email'}">邮箱</th:block>
                    <th:block th:if="${var.verify_rule=='url'}">链接</th:block>
                    <th:block th:if="${var.verify_rule=='number'}">数字</th:block>
                    <th:block th:if="${var.verify_rule=='date'}">日期</th:block>
                    <th:block th:if="${var.verify_rule=='identity'}">身份证号</th:block>
                    <th:block th:if="${var.verify_rule=='longitude'}">经度</th:block>
                    <th:block th:if="${var.verify_rule=='latitude'}">纬度</th:block>
                    <th:block th:if="${var.verify_rule=='float'}">浮点型</th:block>
                    <th:block th:if="${var.verify_rule=='floats'}">可为空浮点型</th:block>
                    <th:block th:if="${var.verify_rule=='field_len10'}">最大长度10字符</th:block>
                    <th:block th:if="${var.verify_rule=='field_len25'}">最大长度25字符</th:block>
                    <th:block th:if="${var.verify_rule=='field_len50'}">最大长度50字符</th:block>
                    <th:block th:if="${var.verify_rule=='field_len100'}">最大长度100字符</th:block>
                    <th:block th:if="${var.verify_rule=='field_len200'}">最大长度200字符</th:block>
                    <th:block th:if="${var.verify_rule=='field_len500'}">最大长度500字符</th:block>
                    <th:block th:if="${var.verify_rule=='field_len1200'}">最大长度1200字符</th:block>
                    <th:block th:if="${var.verify_rule=='field_len5000'}">最大长度5000字符</th:block>
                </td>
                <td>
                    <th:block th:if="${var.show_type=='1'}">文本框</th:block>
                    <th:block th:if="${var.show_type=='2'}">文本域</th:block>
                    <th:block th:if="${var.show_type=='3'}">下拉框</th:block>
                    <th:block th:if="${var.show_type=='4'}">单选框</th:block>
                    <th:block th:if="${var.show_type=='5'}">复选框</th:block>
                    <th:block th:if="${var.show_type=='6'}">富文本</th:block>
                    <th:block th:if="${var.show_type=='7'}">日期控件</th:block>
                    <th:block th:if="${var.show_type=='8'}">上传控件</th:block>
                    <th:block th:if="${var.show_type=='9'}">单选人</th:block>
                    <th:block th:if="${var.show_type=='10'}">单选组织</th:block>
                    <th:block th:if="${var.show_type=='11'}">多选人</th:block>
                    <th:block th:if="${var.show_type=='12'}">多选组织</th:block>
                    <th:block th:if="${var.show_type=='0'}">隐藏字段</th:block>
                </td>
                <td>
                    <th:block th:if="${var.show_type=='3'||var.show_type=='4'||var.show_type=='5'}">
                        <span th:text="${var.option_content}"></span>
                    </th:block>
                </td>
                <td th:text="${var[default_value]?:''}"></td>
                <td th:text="${var.order_by}"></td>
            </tr>
            </th:block>
        </th:block>
        <tr>
            <td colspan="13" style="line-height: 32px">
                选项内容说明：模式一：取值方式：[值]/[显示文字];[值]/[显示文字];...。例：【0/北京;1/上海;2/深圳】。模式二：关联字典表，选项内容填写父节点字段code值，默认值填写对应code值。
            </td>
        </tr>
        </tbody>
    </table>
    <th:block th:if="${p.temp_type=='1'}">
    <div id="tempType1">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
            <legend>关联表信息设置</legend>
        </fieldset>
        <hr class="layui-bg-green">
        <table width="95%" style="margin: 0 auto">
            <tr>
                <td width="15%" align="right"><label class="layui-form-label">选择关联子表：<span style="color: red">*</span></label></td>
                <td>
                    ${linkTablePd.link_table_comment}【${linkTablePd.link_table_name}】
                </td>
                <td width="15%" align="right"><label class="layui-form-label">选择关联字段：<span style="color: red">*</span></label></td>
                <td>
                    ${linkTablePd.link_field_comment}【${linkTablePd.link_field_name}】
                </td>
            </tr>
        </table>
        <table class="layui-table" style="width: 99%;margin: 0 auto">
            <thead>
            <tr>
                <th>序号</th>
                <th width="8%">字段名称</th>
                <th width="8%">字段描述</th>
                <th width="8%">字段类型</th>
                <th>添加编辑</th>
                <th>校验规则</th>
                <th>显示类型</th>
                <th>选项内容</th>
                <th>默认值</th>
                <th>排序</th>
            </tr>
            </thead>
            <tbody id="link_tbody">
                <th:block th:each="var,status:${linkFieldList}">
                    <th:block th:unless="${#strings.containsIgnoreCase(pd.excludeField,var.field_name)}">
                        <tr style="height: 40px">
                            <td th:text="${status.index}"></td>
                            <td th:text="${var.field_name}"></td>
                            <td th:text="${var.field_comment}"></td>
                            <td th:text="${var.field_type}"></td>
                            <td>
                                <th:block th:if="${var.field_operat=='Y'}">
                                    <input type="checkbox" disabled lay-filter='checkField' lay-skin="primary" checked title="">
                                </th:block>
                                <th:block th:if="${var.field_operat!='Y'}">
                                    <input type="checkbox" disabled lay-filter='checkField' lay-skin="primary" title="">
                                </th:block>
                            </td>
                            <td>
                                <th:block th:unless="${#strings.containsIgnoreCase(var.verify_rule,',')}">
                                    <span th:text="${var.verify_rule}"></span>
                                </th:block>
                                <th:block th:if="${var.verify_rule=='required'}">必输</th:block>
                                <th:block th:if="${var.verify_rule=='phone'}">电话</th:block>
                                <th:block th:if="${var.verify_rule=='email'}">邮箱</th:block>
                                <th:block th:if="${var.verify_rule=='url'}">链接</th:block>
                                <th:block th:if="${var.verify_rule=='number'}">数字</th:block>
                                <th:block th:if="${var.verify_rule=='date'}">日期</th:block>
                                <th:block th:if="${var.verify_rule=='identity'}">身份证号</th:block>
                                <th:block th:if="${var.verify_rule=='longitude'}">经度</th:block>
                                <th:block th:if="${var.verify_rule=='latitude'}">纬度</th:block>
                                <th:block th:if="${var.verify_rule=='float'}">浮点型</th:block>
                                <th:block th:if="${var.verify_rule=='floats'}">可为空浮点型</th:block>
                                <th:block th:if="${var.verify_rule=='field_len10'}">最大长度10字符</th:block>
                                <th:block th:if="${var.verify_rule=='field_len25'}">最大长度25字符</th:block>
                                <th:block th:if="${var.verify_rule=='field_len50'}">最大长度50字符</th:block>
                                <th:block th:if="${var.verify_rule=='field_len100'}">最大长度100字符</th:block>
                                <th:block th:if="${var.verify_rule=='field_len200'}">最大长度200字符</th:block>
                                <th:block th:if="${var.verify_rule=='field_len500'}">最大长度500字符</th:block>
                                <th:block th:if="${var.verify_rule=='field_len1200'}">最大长度1200字符</th:block>
                                <th:block th:if="${var.verify_rule=='field_len5000'}">最大长度5000字符</th:block>
                            </td>
                            <td>
                                <th:block th:if="${var.show_type=='1'}">文本框</th:block>
                                <th:block th:if="${var.show_type=='2'}">文本域</th:block>
                                <th:block th:if="${var.show_type=='3'}">下拉框</th:block>
                                <th:block th:if="${var.show_type=='4'}">单选框</th:block>
                                <th:block th:if="${var.show_type=='5'}">复选框</th:block>
                                <th:block th:if="${var.show_type=='6'}">富文本</th:block>
                                <th:block th:if="${var.show_type=='7'}">日期控件</th:block>
                                <th:block th:if="${var.show_type=='8'}">上传控件</th:block>
                                <th:block th:if="${var.show_type=='9'}">单选人</th:block>
                                <th:block th:if="${var.show_type=='10'}">单选组织</th:block>
                                <th:block th:if="${var.show_type=='11'}">多选人</th:block>
                                <th:block th:if="${var.show_type=='12'}">多选组织</th:block>
                                <th:block th:if="${var.show_type=='0'}">隐藏字段</th:block>
                            </td>
                            <td>
                                <th:block th:if="${var.show_type=='3'||var.show_type=='4'||var.show_type=='5'}">
                                    <span th:text="${var.option_content}"></span>
                                </th:block>
                            </td>
                            <td th:text="${var.default_value}"></td>
                            <td th:text="${var.order_by}"></td>
                        </tr>
                    </th:block>
                </th:block>
            </tbody>
        </table>
    </div>
    </th:block>
    <th:block th:if="${p.temp_type=='2'}">
    <div id="tempType2">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
            <legend>树结构信息设置</legend>
        </fieldset>
        <hr class="layui-bg-green">
        <table class="layui-table" style="width:95%;margin:10px auto;">
            <tr>
                <td width="15%" align="right"><label class="layui-form-label">父节点字段：<span style="color: red">*</span></label></td>
                <td>
                    <span th:text="${p.tree_pid_comment}"></span>【<span th:text="${p[tree_pid]?:''}"></span>】
                </td>
                <td width="15%" align="right"><label class="layui-form-label">节点名称字段：<span style="color: red">*</span></label></td>
                <td>
                    <span th:text="${p.tree_name_comment}"></span>【<span th:text="${p.tree_name}"></span>】
                </td>
            </tr>
        </table>
    </div>
    </th:block>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
        <legend>其他信息设置</legend>
    </fieldset>
    <hr class="layui-bg-green">
    <table class="layui-table" style="width:95%;margin:10px auto;">
        <tr>
            <td align="right" style="width: 15%"><label class="layui-form-label">排序号：</label></td>
            <td colspan="3" th:text="${p.order_by}"></td>
        </tr>
        <tr>
            <td align="right"><label class="layui-form-label">备注：</label></td>
            <td colspan="3" th:text="${p.remark}"></td>
        </tr>
        <tr>
            <td style="text-align: center; padding-top: 10px;" colspan="4">
                <div class="layui-form-item">
                    <button type="button" class="layui-btn layui-btn-danger layui-btn-sm" id="cancel">关闭</button>
                </div>
            </td>
        </tr>
    </table>
</form>
<div id="menuContent" class="menuContent" style="display:none; position: absolute; background-color: #eaeaea; min-height: 300px;min-width:180px;z-index:999; ">
    <ul id="selectMenuZtree" class="ztree" style="margin-top:0; min-width:180px; min-height: 300px;"></ul>
</div>
<script type="text/javascript" th:src="@{/static/plugins/xadmin/lib/layui/layui.js}" charset="utf-8"></script>
<script type="text/javascript" th:src="@{/static/js/qfverify.js}"></script>
<script type="text/javascript" th:src="@{/static/js/qfAjaxReq.js}"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script type="text/javascript" th:src="@{/static/plugins/ztree/js/jquery.ztree.core.js}"></script>
<script type="text/javascript" th:src="@{/static/plugins/ztree/js/jquery.ztree.excheck.js}"></script>
<link rel="stylesheet" th:href="@{/static/plugins/ztree/css/zTreeStyle/zTreeStyle.css}" type="text/css" />
<th:block th:include="web/system/gencode/select_menu"></th:block>

<script>
    var form,layer;
    layui.use(['form'], function(){
        form = layui.form;
        layer = layui.layer;

        $('#cancel').on('click',function (){
            var index = parent.layer.getFrameIndex("gencode_info");
            parent.layer.close(index);
        });

    });

</script>

<th:block th:include="/web/system/admin/include :: bottom" />
</body>
</html>